#include <iostream>
#include <algorithm>

using namespace std;
const int N = 110, M = 2e4 + 10;

int a[N][N], f[N][M];
int s, n, m;

int main()
{
	cin >> s >> n >> m;
	for(int j = 1; j <= s; j++)
	{
		for(int i = 1; i <= n; i++)
		{
			cin >> a[i][j];
			a[i][j] = a[i][j] * 2 + 1;
		}
	}
	for(int i = 1; i <= n; i++) sort(a[i] + 1, a[i] + s + 1);
	
	for(int i = 1; i <= n; i++)
	{
		for(int j = 0; j <= m; j++)
		{
			f[i][j] = f[i - 1][j];
			for(int k = 1; k <= s && j >= a[i][k]; k++)
			{
				f[i][j] = max(f[i][j], f[i - 1][j - a[i][k]] + k * i);
			}
		}
	}
	cout << f[n][m] << endl;
	return 0;
}
